home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 May: Tool Chest / Developer CD Series Tool Chest (Apple Computer)(May 1999).iso / What's New? / • What was new 03⁄99 / Tool Chest / Sample Code / Eject PC Cards Location Module / Sources / EjectPCCardModule.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-12-22  |  3.4 KB  |  129 lines  |  [TEXT/CWIE]

  1. /*
  2.      File:        Sample.h
  3.  
  4.      Contains:    Location Manager SDK Sample Module Rez/C includes
  5.  
  6.      Version:    ALM SDK 2.0
  7.                  Package:    Location Manager SDK 2.0
  8.  
  9.      Copyright:    © 1996-1997 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        Please include the the file and version information (from above) with
  13.                  the problem description.  Developers belonging to one of the Apple
  14.                  developer programs can submit bug reports to:
  15.  
  16.                      devsupport@apple.com
  17.  
  18. */
  19.  
  20. #ifndef        __SAMPLE__
  21. #define        __SAMPLE__
  22.  
  23. // ------------------------------------------------------------------------------------------------- 
  24.  
  25. #ifdef    REZ
  26.  
  27. #include    "Types.r"
  28.  
  29. #else
  30.  
  31. #include    <Types.h>
  32.  
  33. // Types...
  34.  
  35. typedef struct {
  36.     UInt32            version;            // Version of the setting...
  37.     SInt32            slot;                // PC Card slot to eject...
  38. } SettingRec, *SettingPtr, **SettingHandle;
  39.  
  40. // ------------------------------------------------------------------------------------------------- 
  41.  
  42. typedef pascal OSStatus (*ResourceProc)(long);
  43.  
  44. enum {
  45.     uppxxxprocInfo = kPascalStackBased
  46.          | RESULT_SIZE (SIZE_CODE(sizeof(OSStatus)))
  47.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(long)))
  48. };
  49.  
  50. #if USESROUTINEDESCRIPTORS
  51. typedef UniversalProcPtr    ResourceProcUPP;
  52. #define CallResourceProc(userRoutine, params)    \
  53.         CallUniversalProc((UniversalProcPtr)(userRoutine), ResourceProcInfo, params)
  54. #define NewResourceProcPPC(userRoutine)    \
  55.         (ResourceProcUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), ResourceProcInfo, kPowerPCISA)
  56. #define NewResourceProc68k(userRoutine)    \
  57.         (ResourceProcUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), ResourceProcInfo, kM68kISA)
  58. #else
  59. typedef ResourceProc    ResourceProcUPP;
  60. #define CallResourceProc(userRoutine, params)    \
  61.         ((ResourceProc)(userRoutine))(params)
  62. #define NewResourceProcPPC(userRoutine)    \
  63.         (ResourceProcUPP)(userRoutine)
  64. #define NewResourceProc68k(userRoutine)    \
  65.         (ResourceProcUPP)(userRoutine)
  66. #endif
  67.  
  68. #endif // REZ
  69.  
  70. // ------------------------------------------------------------------------------------------------- 
  71.  
  72. // Errors...
  73.  
  74. // Other text...
  75.  
  76. // Constants for common use...
  77.  
  78. #define        kNoSlotsID                    -1
  79. #define        kBothSlotsID                0
  80. #define        kLowerSlotID                1
  81. #define        kUpperSlotID                2
  82.  
  83. #define        kNoRestart                    0x00
  84. #define        kRestartIfChanged            0x80
  85.  
  86. #define        kExecutableRsrcType            'code'
  87. #define        kExecutableRsrcID            10000
  88.  
  89. #define        kNameRsrcType                'STR '
  90. #define        kNameRsrcID                    10000
  91.  
  92. #define        kDescRsrcType                'STR '
  93. #define        kDescRsrcID                    10001
  94.  
  95. #define        kIconRsrcType                'ICON'
  96. #define        kIconRsrcID                    10000
  97.  
  98. #define        kGetInfoRsrcID                10000
  99.  
  100. #define        kPPCCodeResource            'PPCC'
  101. #define        kPPCCodeResourceID            10000
  102.  
  103. #define        kDescribeSettingStrings        10000
  104. /* Not needed because the STR# entries are number so that (**(SettingHandle)setting).slot + 2 works
  105. #define            kDescribeNeither            1
  106. #define            kDescribeBoth                2
  107. #define            kDescribeLower                3
  108. #define            kDescribeUpper                4
  109. */
  110.  
  111. #define        kModuleNotNeededErr            10000
  112. #define        kNeedPCCardsErr                10001
  113. #define        kNeedPCCard3Err                10002
  114.  
  115. #define        kDescribeErrorStrings        10001
  116. #define            kDescribeResNotFound        1
  117. #define            kDescribeNotNeeded            2
  118. #define            kDescribeNeedPCCards        3
  119. #define            kDescribeNeedPCCard3        4
  120.  
  121. #define        kEditMessageRsrcID            10000
  122. #define            kEditOKButton                1
  123. #define            kEditCancelButton            2
  124. #define            kUpperPCCardCheckBox        3
  125. #define            kLowerPCCardCheckBox        4
  126. // ------------------------------------------------------------------------------------------------- 
  127.  
  128. #endif        // __SAMPLE__
  129.